package com.zmn.mcc.common.dictionary;

import com.google.common.collect.Lists;
import com.zmn.common.constant.GlobalConsts;
import com.zmn.common.dictionary.DictModel;
import com.zmn.common.dictionary.KvModel;
import com.zmn.mcc.common.constant.StaffConsts;

import java.util.ArrayList;
import java.util.Dictionary;
import java.util.List;
import java.util.Optional;

/**
 * @author quanjic
 * @version v1.0
 * @since 2019/10/15 19:48
 **/
public class StaffDict {

    /**
     * 描述:员工类型
     *
     * @return java.util.List<com.zmn.common.dictionary.DictModel>
     * @author tanghongjun
     * @since 9:59 2020/5/19
     **/
    public static List<DictModel> getRoleTypeList() {
        ArrayList<DictModel> arrayList = Lists.newArrayListWithExpectedSize(7);
        arrayList.add(new DictModel(StaffConsts.STAFF_ROLE_ORDINARY_TYPE, StaffConsts.STAFF_ROLE_ORDINARY_TYPE_STR));
        arrayList.add(new DictModel(StaffConsts.STAFF_ROLE_PART_TIME, StaffConsts.STAFF_ROLE_PART_TIME_STR));
        arrayList.add(new DictModel(StaffConsts.STAFF_ROLE_INTERNSHIP, StaffConsts.STAFF_ROLE_INTERNSHIP_STR));
        arrayList.add(new DictModel(StaffConsts.STAFF_ROLE_POST_RETIREMENT, StaffConsts.STAFF_ROLE_POST_RETIREMENT_STR));
        arrayList.add(new DictModel(StaffConsts.STAFF_ROLE_LABOR_DISPATCH, StaffConsts.STAFF_ROLE_LABOR_DISPATCH_STR));
        arrayList.add(new DictModel(StaffConsts.STAFF_ROLE_OUTSOURCING, StaffConsts.STAFF_ROLE_OUTSOURCING_STR));
        arrayList.add(new DictModel(StaffConsts.STAFF_ROLE_MASTER_TYPE, StaffConsts.STAFF_ROLE_MASTER_TYPE_STR));
        return arrayList;
    }

    public static String getRoleTypeName(Integer roleType) {
        switch (roleType) {
            case StaffConsts.STAFF_ROLE_ORDINARY_TYPE:
                return StaffConsts.STAFF_ROLE_ORDINARY_TYPE_STR;
            case StaffConsts.STAFF_ROLE_MASTER_TYPE:
                return StaffConsts.STAFF_ROLE_MASTER_TYPE_STR;
            case StaffConsts.STAFF_ROLE_PART_TIME:
                return StaffConsts.STAFF_ROLE_PART_TIME_STR;
            case StaffConsts.STAFF_ROLE_INTERNSHIP:
                return StaffConsts.STAFF_ROLE_INTERNSHIP_STR;
            case StaffConsts.STAFF_ROLE_LABOR_DISPATCH:
                return StaffConsts.STAFF_ROLE_LABOR_DISPATCH_STR;
            case StaffConsts.STAFF_ROLE_POST_RETIREMENT:
                return StaffConsts.STAFF_ROLE_POST_RETIREMENT_STR;
            case StaffConsts.STAFF_ROLE_OUTSOURCING:
                return StaffConsts.STAFF_ROLE_OUTSOURCING_STR;
            default:
                return "";
        }
    }

    public static int getRoleTypeByName(String roleTypeName) {
        switch (roleTypeName) {
            case StaffConsts.STAFF_ROLE_ORDINARY_TYPE_STR:
                return StaffConsts.STAFF_ROLE_ORDINARY_TYPE;
            case StaffConsts.STAFF_ROLE_MASTER_TYPE_STR:
                return StaffConsts.STAFF_ROLE_MASTER_TYPE;
            case StaffConsts.STAFF_ROLE_PART_TIME_STR:
                return StaffConsts.STAFF_ROLE_PART_TIME;
            case StaffConsts.STAFF_ROLE_INTERNSHIP_STR:
                return StaffConsts.STAFF_ROLE_INTERNSHIP;
            case StaffConsts.STAFF_ROLE_LABOR_DISPATCH_STR:
                return StaffConsts.STAFF_ROLE_LABOR_DISPATCH;
            case StaffConsts.STAFF_ROLE_POST_RETIREMENT_STR:
                return StaffConsts.STAFF_ROLE_POST_RETIREMENT;
            case StaffConsts.STAFF_ROLE_OUTSOURCING_STR:
                return StaffConsts.STAFF_ROLE_OUTSOURCING;
            default:
                return 0;
        }
    }


    /**
     * 描述:员工状态1.试用 2.正式 3.离职
     *
     * @return java.util.List<com.zmn.common.dictionary.DictModel>
     * @author tanghongjun
     * @since 9:59 2020/5/19
     **/
    public static List<DictModel> getStatusList() {
        ArrayList<DictModel> arrayList = Lists.newArrayListWithExpectedSize(8);
        arrayList.add(new DictModel(StaffConsts.STAFF_STATUS_PROBATION, StaffConsts.STAFF_STATUS_PROBATION_STR));
        arrayList.add(new DictModel(StaffConsts.STAFF_STATUS_NORMAL, StaffConsts.STAFF_STATUS_NORMAL_STR));
        arrayList.add(new DictModel(StaffConsts.STAFF_STATUS_LEAVE, StaffConsts.STAFF_STATUS_LEAVE_STR));
        arrayList.add(new DictModel(StaffConsts.STAFF_STATUS_TO_HIRED, StaffConsts.STAFF_STATUS_TO_HIRED_STR));
        arrayList.add(new DictModel(StaffConsts.STAFF_STATUS_CALL_OUT, StaffConsts.STAFF_STATUS_CALL_OUT_STR));
        arrayList.add(new DictModel(StaffConsts.STAFF_STATUS_IN, StaffConsts.STAFF_STATUS_IN_STR));
        arrayList.add(new DictModel(StaffConsts.STAFF_STATUS_RETIRE, StaffConsts.STAFF_STATUS_RETIRE_STR));
        arrayList.add(new DictModel(StaffConsts.STAFF_STATUS_NO_NORMAL, StaffConsts.STAFF_STATUS_NO_NORMAL_STR));
        return arrayList;
    }

    public static String getStatusName(int staffStatus) {
        switch (staffStatus) {
            case StaffConsts.STAFF_STATUS_PROBATION:
                return StaffConsts.STAFF_STATUS_PROBATION_STR;
            case StaffConsts.STAFF_STATUS_NORMAL:
                return StaffConsts.STAFF_STATUS_NORMAL_STR;
            case StaffConsts.STAFF_STATUS_LEAVE:
                return StaffConsts.STAFF_STATUS_LEAVE_STR;
            case StaffConsts.STAFF_STATUS_TO_HIRED:
                return StaffConsts.STAFF_STATUS_TO_HIRED_STR;
            case StaffConsts.STAFF_STATUS_CALL_OUT:
                return StaffConsts.STAFF_STATUS_CALL_OUT_STR;
            case StaffConsts.STAFF_STATUS_IN:
                return StaffConsts.STAFF_STATUS_IN_STR;
            case StaffConsts.STAFF_STATUS_RETIRE:
                return StaffConsts.STAFF_STATUS_RETIRE_STR;
            case StaffConsts.STAFF_STATUS_NO_NORMAL:
                return StaffConsts.STAFF_STATUS_NO_NORMAL_STR;
            default:
                return "";
        }
    }

    /**
     * 描述:职级1.专员 2.主管 3.经理 4.总监
     *
     * @return java.util.List<com.zmn.common.dictionary.DictModel>
     * @author tanghongjun
     * @since 9:59 2020/5/19
     **/
    public static List<DictModel> getLevelList() {
        ArrayList<DictModel> arrayList = Lists.newArrayListWithExpectedSize(5);
        arrayList.add(new DictModel(StaffConsts.STAFF_LEVEL_COMMISSION, StaffConsts.STAFF_LEVEL_COMMISSION_STR));
        arrayList.add(new DictModel(StaffConsts.STAFF_LEVEL_DIRECTOR, StaffConsts.STAFF_LEVEL_DIRECTOR_STR));
        arrayList.add(new DictModel(StaffConsts.STAFF_LEVEL_MANAGER, StaffConsts.STAFF_LEVEL_MANAGER_STR));
        arrayList.add(new DictModel(StaffConsts.STAFF_LEVEL_MIDDLE_MANAGER, StaffConsts.STAFF_LEVEL_MIDDLE_MANAGER_STR));
        arrayList.add(new DictModel(StaffConsts.STAFF_LEVEL_GRNERAL_MANAGER, StaffConsts.STAFF_LEVEL_GRNERAL_MANAGER_STR));
        return arrayList;
    }

    /**
     * 描述:职序类型：M(管理序列)，S(营销序列)，F(运营序列)，T(技术序列)，P(职能序列)
     *
     * @return java.util.List<com.zmn.common.dictionary.DictModel>
     * @author tanghongjun
     * @since 9:59 2020/5/19
     **/
    public static String getGradesTypeName(String gradesType) {
        switch (gradesType) {
            case StaffConsts.GRADES_TYPE_M:
                return StaffConsts.GRADES_TYPE_M_STR;
            case StaffConsts.GRADES_TYPE_S:
                return StaffConsts.GRADES_TYPE_S_STR;
            case StaffConsts.GRADES_TYPE_F:
                return StaffConsts.GRADES_TYPE_F_STR;
            case StaffConsts.GRADES_TYPE_T:
                return StaffConsts.GRADES_TYPE_T_STR;
            case StaffConsts.GRADES_TYPE_P:
                return StaffConsts.GRADES_TYPE_P_STR;
            default:
                return "";
        }
    }

    public static List<KvModel> getGradesTypeList() {
        ArrayList<KvModel> arrayList = Lists.newArrayListWithExpectedSize(5);
        arrayList.add(new KvModel(StaffConsts.GRADES_TYPE_M, StaffConsts.GRADES_TYPE_M_STR));
        arrayList.add(new KvModel(StaffConsts.GRADES_TYPE_S, StaffConsts.GRADES_TYPE_S_STR));
        arrayList.add(new KvModel(StaffConsts.GRADES_TYPE_F, StaffConsts.GRADES_TYPE_F_STR));
        arrayList.add(new KvModel(StaffConsts.GRADES_TYPE_T, StaffConsts.GRADES_TYPE_T_STR));
        arrayList.add(new KvModel(StaffConsts.GRADES_TYPE_P, StaffConsts.GRADES_TYPE_P_STR));
        return arrayList;
    }

    public static String getLevelName(int positionLevel) {
        switch (positionLevel) {
            case StaffConsts.STAFF_LEVEL_COMMISSION:
                return StaffConsts.STAFF_LEVEL_COMMISSION_STR;
            case StaffConsts.STAFF_LEVEL_DIRECTOR:
                return StaffConsts.STAFF_LEVEL_DIRECTOR_STR;
            case StaffConsts.STAFF_LEVEL_MANAGER:
                return StaffConsts.STAFF_LEVEL_MANAGER_STR;
            case StaffConsts.STAFF_LEVEL_MIDDLE_MANAGER:
                return StaffConsts.STAFF_LEVEL_MIDDLE_MANAGER_STR;
            case StaffConsts.STAFF_LEVEL_GRNERAL_MANAGER:
                return StaffConsts.STAFF_LEVEL_GRNERAL_MANAGER_STR;
            default:
                return "";
        }
    }

    /**
     * 描述:试用期：1.一个月，2.2个月，3.3个月，4.4个月，5.5个月，6.6个月，7.其它
     *
     * @return java.util.List<com.zmn.common.dictionary.DictModel>
     * @author tanghongjun
     * @since 9:59 2020/5/19
     **/
    public static List<DictModel> getProbationPeriodTypeList() {
        ArrayList<DictModel> arrayList = Lists.newArrayListWithExpectedSize(7);
        arrayList.add(new DictModel(StaffConsts.PROBATION_PERIOD_TYPE_ONE_MONTH, StaffConsts.PROBATION_PERIOD_TYPE_ONE_MONTH_STR));
        arrayList.add(new DictModel(StaffConsts.PROBATION_PERIOD_TYPE_TWO_MONTH, StaffConsts.PROBATION_PERIOD_TYPE_TWO_MONTH_STR));
        arrayList.add(new DictModel(StaffConsts.PROBATION_PERIOD_TYPE_THREE_MONTH, StaffConsts.PROBATION_PERIOD_TYPE_THREE_MONTH_STR));
        arrayList.add(new DictModel(StaffConsts.PROBATION_PERIOD_TYPE_FOUR_MONTH, StaffConsts.PROBATION_PERIOD_TYPE_FOUR_MONTH_STR));
        arrayList.add(new DictModel(StaffConsts.PROBATION_PERIOD_TYPE_FIVE_MONTH, StaffConsts.PROBATION_PERIOD_TYPE_FIVE_MONTH_STR));
        arrayList.add(new DictModel(StaffConsts.PROBATION_PERIOD_TYPE_SIX_MONTH, StaffConsts.PROBATION_PERIOD_TYPE_SIX_MONTH_STR));
        arrayList.add(new DictModel(StaffConsts.PROBATION_PERIOD_TYPE_OTHER, StaffConsts.PROBATION_PERIOD_TYPE_OTHER_STR));
        return arrayList;
    }

    public static String getProbationPeriodTypeName(int roleType) {
        switch (roleType) {
            case StaffConsts.PROBATION_PERIOD_TYPE_ONE_MONTH:
                return StaffConsts.PROBATION_PERIOD_TYPE_ONE_MONTH_STR;
            case StaffConsts.PROBATION_PERIOD_TYPE_TWO_MONTH:
                return StaffConsts.PROBATION_PERIOD_TYPE_TWO_MONTH_STR;
            case StaffConsts.PROBATION_PERIOD_TYPE_THREE_MONTH:
                return StaffConsts.PROBATION_PERIOD_TYPE_THREE_MONTH_STR;
            case StaffConsts.PROBATION_PERIOD_TYPE_FOUR_MONTH:
                return StaffConsts.PROBATION_PERIOD_TYPE_FOUR_MONTH_STR;
            case StaffConsts.PROBATION_PERIOD_TYPE_FIVE_MONTH:
                return StaffConsts.PROBATION_PERIOD_TYPE_FIVE_MONTH_STR;
            case StaffConsts.PROBATION_PERIOD_TYPE_SIX_MONTH:
                return StaffConsts.PROBATION_PERIOD_TYPE_SIX_MONTH_STR;
            case StaffConsts.PROBATION_PERIOD_TYPE_OTHER:
                return StaffConsts.PROBATION_PERIOD_TYPE_OTHER_STR;
            default:
                return "";
        }
    }

    /**
     * 描述:
     *
     * @param
     * @return
     * @author guoqiao
     * @since 2021/3/1 11:26
     */
    public static List<DictModel> getSexTypeList() {
        ArrayList<DictModel> arrayList = Lists.newArrayListWithExpectedSize(3);
        arrayList.add(new DictModel(StaffConsts.SEX_TYPE_MALE, StaffConsts.SEX_TYPE_MALE_STR));
        arrayList.add(new DictModel(StaffConsts.SEX_TYPE_FEMALE, StaffConsts.SEX_TYPE_FEMALE_STR));
        arrayList.add(new DictModel(StaffConsts.SEX_TYPE_SECRET, StaffConsts.SEX_TYPE_SECRET_STR));
        return arrayList;
    }

    public static String getSexTypeName(int sexType) {
        switch (sexType) {
            case StaffConsts.SEX_TYPE_MALE:
                return StaffConsts.SEX_TYPE_MALE_STR;
            case StaffConsts.SEX_TYPE_FEMALE:
                return StaffConsts.SEX_TYPE_FEMALE_STR;
            case StaffConsts.SEX_TYPE_SECRET:
                return StaffConsts.SEX_TYPE_SECRET_STR;
            default:
                return "";
        }
    }

    public static String getStatusTypeName(int status) {
        switch (status) {
            case GlobalConsts.STATUS_FORBIDDEN:
                return "禁用";
            case GlobalConsts.STATUS_NORMOL:
                return "启用";
            default:
                return "";
        }
    }


}
